# coding: utf-8
# Author: Legend奇
# @Time： 2020/11/27 上午9:57
from marshmallow import Schema


class BaseSchema(Schema):

    @classmethod
    def to_dict(cls, model=None, many=False, ):
        return cls().dump(model, many=many)

# class BaseOrmSchema(PydanticModel):
#     sub_menu = Field()
#
#     def __init__(self, **kwargs):
#         super(BaseOrmSchema, self).__init__(**kwargs)
#
#     @staticmethod
#     async def serializer(queryset, many=False):
#         if many:
#             await BaseOrmSchema.from_queryset(queryset)
#         else:
#             await BaseOrmSchema.from_tortoise_orm(queryset)
#
#
# class BaseQuerySetSchema(PydanticListModel):
#
#     def __init__(self, **kwargs):
#         super(BaseQuerySetSchema, self).__init__(**kwargs)
